package org.example.text03;

/**
 * 大刀实现类，实现战士武器接口
 */

public class Bolo implements Weapon{
    private Soldier soldier;

    public Bolo() {
    }

    public Bolo(Soldier soldier) {
        this.soldier = soldier;
    }

    public Soldier getSoldier() {
        return soldier;
    }

    public void setSoldier(Soldier soldier) {
        this.soldier = soldier;
    }

    @Override
    public int fire() {
        if (soldier.getAge() > 18){
            return 100;
        }else {
            return 50;
        }

    }
}
